//
//  CurrentToNew.m
//  ClienteHabitueIOS
//
//  Created by Mauro Carreño on 11/15/12.
//
//

#import "CurrentToNew.h"


@implementation CurrentToNew


- (void)perform
{
    UIViewController *source = self.sourceViewController;
    UIWindow *window = source.view.window;
    
    CATransition *transition = [CATransition animation];
    [transition setDuration:[self transitionDuration]];
    [transition setDelegate:self];
    [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
    [transition setType:[self transitionType]];
    [transition setSubtype:[self transitionSubType]];
    
    [window.layer addAnimation:transition forKey:kCATransition];
    [window setRootViewController:self.destinationViewController];
}



- (NSString*)transitionType
{
    return @"flip";
}

- (NSString*)transitionSubType
{
    return kCATransitionFromRight;
}

- (CFTimeInterval)transitionDuration
{
    return 0.5;
}


@end